#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
	int end1 = m - 1, end2 = n - 1, end = m + n - 1;
	while (end2 >= 0)
	{
		if (end1 < 0 || nums2[end2] > nums1[end1])
			nums1[end--] = nums2[end2--];
		else
			nums1[end--] = nums1[end1--];
	}
}


int main()
{
	int arr1[20] = { 1,2,3,4,5,6 };
	int arr2[] = { 2,2,3,3,5,6 };
	merge(arr1, 6, 6, arr2, 6, 6);

	return 0;
}


